﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Gfw.Infrastructure.Stock.Enums;
using StockWcf.Manager;

namespace StockWcf
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码、svc 和配置文件中的类名“StockWcfService”。
    public class StockWcfService : IStockWcfService
    {
        public void Trade()
        {
            TradeManager.Execute();
        }

        public void CancelTrade(string agencyid)
        {
            TradeManager.CancelTrade(agencyid);
        }


        public decimal GetPrice()
        {
            return MarketManager.Market.CurrentPrice;
        }


        public void SetMarketState(int state)
        {
            MarketManager.ChageMarketState(
                (MarketRunningStateEnum) Enum.ToObject(typeof (MarketRunningStateEnum), state));
        }


        public int GetMarketState()
        {
            return MarketManager.Market.RunningState;

           
        }
    }
}
